$(document).ready(function(){
	$('#submit').bind('click',subFrm);
})

function subFrm(){
	var uObj = $('#LOGIN_NAME');
	if($.trim(uObj.val()).length == 0){
		alert('用户名不能为空');
		uObj.focus();
		return;
	}
	var pObj = $('#PASSWORD');
	if($.trim(pObj.val()).length == 0){
		alert('密码不能为空');
		pObj.focus();
		return;
	}
	var options = {
	    dataType: 'json',
    	iframe:	false,
	    success: function(data) {
	    	if(data.success){
	      		location.href = adminPath + '/system/user_list.html?menu=sys_manage&tab=user_list&current_page=' + currentPage;
	      	}else{
	      		alert(data.errors.errmsg);
	      	}
	   	}
	};
	$.ajaxSetup({contentType:'application/x-www-form-urlencoded;charset=utf-8'});
    $('#frm').ajaxSubmit(options);
}